package com.xkdx.guangguang.fragment.shopinfo;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import com.xkdx.guangguang.module.network.AbsAction;

public class ShopInfoAction extends AbsAction {
	String shopID, newInfoRefreshTime, commentRefreshTime;

	public ShopInfoAction(String shopID, String newInfoRefreshTime, String commentRefreshTime) {
		this.shopID = shopID;
		this.newInfoRefreshTime = newInfoRefreshTime;
		this.commentRefreshTime = commentRefreshTime;
	}

	@Override
	public void constructRequest() {
		// 商场详情
		HashMap<String, String> map = new HashMap<String, String>();
		map.put("DeviceID", "2");
		map.put("ShopID", shopID);
		String shopDetailJson = constructJson(map);
		Parameter parameter = new Parameter("shopInterface", "getShopDetail", shopDetailJson);
		// 优惠信息
		HashMap<String, String> newInfomap = new HashMap<String, String>();
		newInfomap.put("DeviceID", "2");
		newInfomap.put("ShopID", shopID);
		newInfomap.put("InfoType", "1|2");
		newInfomap.put("PageIndex", "1");
		newInfomap.put("PageSize", "30");
		newInfomap.put("RefreshTime", newInfoRefreshTime);
		String newInfoJson = constructJson(newInfomap);
		Parameter newInfoparameter = new Parameter("informationInterface", "getInfoListByShop", newInfoJson);

		// 评论
		HashMap<String, String> commentmap = new HashMap<String, String>();
		commentmap.put("DeviceID", "2");
		commentmap.put("ShopID", shopID);
		commentmap.put("PageIndex", "1");
		commentmap.put("PageSize", "10");
		commentmap.put("RefreshTime", newInfoRefreshTime);
		String commentJson = constructJson(commentmap);
		Parameter commentParameter = new Parameter("commentInterface", "getCommentListByShop", commentJson);

		List<Parameter> list = new ArrayList<AbsAction.Parameter>();
		list.add(parameter);
		list.add(newInfoparameter);
		list.add(commentParameter);
		requestData = constructMod(list);

	}

}
